@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <form class="form-horizontal">
            <div class="row">
                <input type="hidden" value="${org.id}" name="orgId" >
                <input type="hidden" value="${item.id}" name="id" >
                <div class="col-sm-12 b-r">
                    <#input id="name"  name="方案名称" underline="true" value="${item.name}"/>
                    <#select id="termId" name="所属学期" >
                    @for(term in schoolTerm){
                    <option value="${term.termId}" ${item.termId==(''+term.termId+'')?'selected':""}>${term.termName}</option>
                    @}
                </#select>
                <div class="form-group" style="float:left;display:flex;width:100%">
                    <label class="labels">方案应用时间:</label>
                    <input class="form-control" style="width: 40%"  type="text" placeholder="开始时间"  name="startTime" value="${startTime}" id="startTime" readonly="true">
                    <span style="float:left;margin:6px;">至</span>
                    <input class="form-control" style="width: 40%"   type="text" placeholder="结束时间"  value="${endTime}"   name="endTime" id="endTime" readonly="true">
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group" style="float:left;display:flex;width:100%">
                    <label class="labels">每周应用范围:</label>
                    @for(week in metaList){
                    <input  type="checkbox" id="week" name="week" readonly value="${week.value}">${week.name}
                    @}
                </div>
                <div class="hr-line-dashed"></div>
                <#select id="sections" name="节次数量" underline="true">
                @for(section in sectionCount){
                <option value="${section}" ${item.sections==section?'selected':""}>${section}</option>
                @}
            </#select>
            <div class="unit">
                <label class="labels">各节次时间：</label>
                <table id="table1" class="table1">
                    @for(st in stList){
                        <tr>
                            <td>${st.name}</td>
                            <td>
                                <input onclick="getPoint()" onmouseout="openDisabled()" name="stStartTime" type="time" datefmt="HH:mm" value="${st.startTime}" class="val_name_ required"><font>至</font><input value="${st.endTime}" datefmt="HH:mm" type="time" name="stEndTime" class="val_name_ required">
                            </td>
                        </tr>
                    @}
                </table>
            </div>
        </form>
    </div>

    <div class="row btn-group-m-t">
        <div class="col-sm-10" style="text-align: center">
            <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="PtSectionCategoryInfoDlg.editSubmit()"/>
            <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="PtSectionCategoryInfoDlg.close()"/>
        </div>
    </div>
</div>

</div>
</div>
<script src="${ctxPath}/static/modular/system/ptSectionCategory/ptSectionCategory_info.js"></script>
<style>
    .labels{
        float: left;
        width: 120px;
        padding: 0 5px;
        line-height: 21px;
        margin-left: 107px;

    }
    .unit{
        display: block;
        margin: 0;
        padding: 5px 0;
        position: relative;
        clear: both;
    }
    table {
        width: 100px;
        table-layout: initial;
    }
    .table1 {
        border-collapse: separate;
        border-spacing: 0;
        margin-left: 148px;
        font-size: 15px;
    }

</style>
<script>
    function getPoint() {
        $("#name").attr("disabled",true);
    }

    function openDisabled(){
        $("#name").attr("disabled",false);
    }
    $(document).ready(function(){
        var checkBoxAll =$("input[name='week']");
        var checkArray='${weekList}';

        for(var i=0;i< checkArray.length;i++){//
            $.each(checkBoxAll,function(j,checkbox){
                var checkValue=$(checkbox).val();
                if(checkArray[i]==checkValue){
                    $(checkbox).prop("checked",true);
                }
            })
        }
    });
</script>
@}
